## Warning: We recommend using the dplyr::*_join() family of functions instead.
## Warning: `group_by_()` was deprecated in dplyr 0.7.0.
## Please use `group_by()` instead.
## See vignette('programming') for more help
## This warning is displayed once every 8 hours.
## Call `lifecycle::last_lifecycle_warnings()` to see where this warning was generated.
## Warning: sf layer has inconsistent datum (+proj=longlat +datum=NAD83 +no_defs).
## Need '+proj=longlat +datum=WGS84'
## Warning: We recommend using the dplyr::*_join() family of functions instead.
## Warning: sf layer has inconsistent datum (+proj=longlat +datum=NAD83 +no_defs).
## Need '+proj=longlat +datum=WGS84'

hh_income brackets with 30% or more spent on rent

Number of Eligible household by amount of hh_income with 30% spent on rent category

Number of Eligible household with hh_income less than 75k with 30% spent on rent.

Proportion of household with hh_income less than 75k and 30% spent on rent NOT receiving assisstance.

Number of households spending above 30% and 50% of hh_income on rent.

Proportion of households spending above 30% and 50% of hh_income on rent and not receiving assitance.

30% or more spent on rent with rent category

Number of Eligible household by percentage of hh_income spent on rent category

## `summarise()` has grouped output by 'county'. You can override using the
## `.groups` argument.

Number of Eligible household vs Number reported for Kent

Number of Eligible household vs Number reported for NC

Number of Eligible household vs Number reported for Sussex

Number of household eligible for receiving rental assistance by housing vouchers

Number of household receiving rental assistance by housing vouchers

Proportion of household not receiving rental assistance by housing vouchers

Exploring the disparity between 30% vs 50%

acs_hud_de_geojoined_prop <- acs_hud_de_geojoined %>%
    mutate(diff_30_50 = eligible_renters - eligible_renters_50pct) %>%
    mutate(eligible_renters_30pct_prop = eligible_renters / renter_householdersE,
           eligible_renters_50pct_prop = eligible_renters_50pct / renter_householdersE,
           diff_prop_30_50 = eligible_renters_30pct_prop - eligible_renters_50pct_prop)
scatter_30_50 <- acs_hud_de_geojoined_prop %>%
    ggplot(aes(x = eligible_renters, y = eligible_renters_50pct,
               label = census_tract_label, color = diff_30_50)) +
        geom_smooth(method = "lm") + 
    geom_point() +
    xlab("Households paying 30%+ on rent") +
    ylab("Households paying 50%+ on rent")

ggplotly(scatter_30_50)
## `geom_smooth()` using formula 'y ~ x'
barplot_30_50_diff <- acs_hud_de_geojoined_prop %>%
    ggplot(aes(x = reorder(tract, diff_30_50), y = diff_30_50)) + 
    geom_bar(stat = "identity") +
    xlab("Census Tracts") +
    ylab("Difference between 30% vs 50%")
barplot_30_50_diff %>% ggplotly()
scatter_30_50_prop <- acs_hud_de_geojoined_prop %>% 
    ggplot(aes(x = eligible_renters_30pct_prop, y = eligible_renters_50pct_prop,
               label = census_tract_label, color = diff_prop_30_50)) +
        geom_smooth(method = "lm") + 
    geom_point() +
    xlab("Proportions of households paying 30%+ on rent") +
    ylab("Proportions of households paying 50%+ on rent")

ggplotly(scatter_30_50_prop)
## `geom_smooth()` using formula 'y ~ x'
## Warning: Removed 4 rows containing non-finite values (stat_smooth).
barplot_30_50_prop_diff <- acs_hud_de_geojoined_prop %>%
    ggplot(aes(x = reorder(tract, diff_prop_30_50), y = diff_prop_30_50)) + 
    geom_bar(stat = "identity") +
    xlab("Census Tracts") +
    ylab("Difference between 30% vs 50% (proportions)") 

barplot_30_50_prop_diff %>% ggplotly()
## Warning: Removed 4 rows containing missing values (position_stack).

Higher numbers mean that the census tract has higher proportions of renters paying 30% or more income on rent than those paying 50% or more income on rent.

How about for the vouchers?

scatter_30_50_voucher <- acs_hud_de_geojoined_prop %>% 
    ggplot(aes(x = prop_serviced, y = diff_prop_30_50, label = tract)) + 
    geom_smooth(method = "lm") +
    geom_point() +
    xlab("Proportion of eligible renters receiving a voucher") +
    ylab("Difference between 30% vs 50% (proportions)")

scatter_30_50_voucher %>% ggplotly()
## `geom_smooth()` using formula 'y ~ x'
## Warning: Removed 55 rows containing non-finite values (stat_smooth).